package statistics.util;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;

public class ExportDB {

	public void writeStatistic() {

		// read hibernate.cfg.xml
		Configuration cfg = new Configuration().configure();

		SessionFactory sessionFactory = cfg.buildSessionFactory();

		SchemaExport export = new SchemaExport(cfg);

		// create database table
		export.create(true, true);
	}

	public static void main(String[] args) {

		// read hibernate.cfg.xml
		Configuration cfg = new Configuration().configure();

		SchemaExport export = new SchemaExport(cfg);

		// create database table
		export.create(true, true);
	}
}
